﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using QuanLyDoanVien.General;
using QuanLyDoanVien.Report;
using QuanLyDoanVien.Controller;
namespace QuanLyDoanVien
{
    public partial class frmChinh : Office2007RibbonForm
    {
        public static String _user;
        public static String _pass;
        public static int _close;
        private PhanQuyenCtrl m_PhanQuyenCtrl = new PhanQuyenCtrl();
        public frmChinh()
        {
            InitializeComponent();
            DataService.OpenConnection();
        }

        private void ribbonPanel1_Click(object sender, EventArgs e)
        {

        }

        frmQLHS _frmQLHS = null;
        private void btnQLHS_Click(object sender, EventArgs e)
        {
            if (_frmQLHS == null || _frmQLHS.IsDisposed)
            {
                _frmQLHS = new frmQLHS();
                _frmQLHS.MdiParent = this;
                _frmQLHS.Show();
            }
            else
                _frmQLHS.Activate();
        }

        frmQLHSViPham _frmQLHSVP = null;
        private void btnQLHSViPham_Click(object sender, EventArgs e)
        {
            if (_frmQLHSVP == null || _frmQLHSVP.IsDisposed)
            {
                _frmQLHSVP = new frmQLHSViPham();
                _frmQLHSVP.MdiParent = this;
                _frmQLHSVP.Show();
            }
            else
                _frmQLHSVP.Activate();
        }

        frmQLHDHS _frmQLHDHS = null;
        private void btnHoatDongHS_Click(object sender, EventArgs e)
        {
            if (_frmQLHDHS == null || _frmQLHDHS.IsDisposed)
            {
                _frmQLHDHS = new frmQLHDHS();
                _frmQLHDHS.MdiParent = this;
                _frmQLHDHS.Show();
            }
            else
                _frmQLHDHS.Activate();
        }

        frmQLCV _frmQLCV = null;
        private void btnQLChucVu_Click(object sender, EventArgs e)
        {
            if (_frmQLCV == null || _frmQLCV.IsDisposed)
            {
                _frmQLCV = new frmQLCV();
                _frmQLCV.MdiParent = this;
                _frmQLCV.Show();
            }
            else
            {
                _frmQLCV.Activate();
            }
        }

        frmQLLop _frmQLLop = null;
        private void btnQLLop_Click(object sender, EventArgs e)
        {
            if (_frmQLLop == null || _frmQLLop.IsDisposed)
            {
                _frmQLLop = new frmQLLop();
                _frmQLLop.MdiParent = this;
                _frmQLLop.Show();
            }
            else
                _frmQLLop.Activate();
        }

        frmQLKL _frmQLKL = null;
        private void btnQLKyLuat_Click(object sender, EventArgs e)
        {
            if (_frmQLKL == null || _frmQLKL.IsDisposed)
            {
                _frmQLKL = new frmQLKL();
                _frmQLKL.MdiParent = this;
                _frmQLKL.Show();
            }
            else
                _frmQLKL.Activate();

        }

        frmQLHD _frmQLHD = null;
        private void btnQLHoatDong_Click(object sender, EventArgs e)
        {
            if (_frmQLHD == null || _frmQLHD.IsDisposed)
            {
                _frmQLHD = new frmQLHD();
                _frmQLHD.MdiParent = this;
                _frmQLHD.Show();
            }
            else
                _frmQLHD.Activate();
        }

        frmQLBiThuChiDoan _frmQLBiThuChiDoan = null;
        private void btnBiThuChiDoan_Click(object sender, EventArgs e)
        {
            if (_frmQLBiThuChiDoan == null || _frmQLBiThuChiDoan.IsDisposed)
            {
                _frmQLBiThuChiDoan = new frmQLBiThuChiDoan();
                _frmQLBiThuChiDoan.MdiParent = this;
                _frmQLBiThuChiDoan.Show();
            }
            else
                _frmQLBiThuChiDoan.Activate();
        }


        frmXuatLop _frmXuatLop = null;
        private void bntReportLop_Click(object sender, EventArgs e)
        {

            if (_frmXuatLop == null || _frmXuatLop.IsDisposed)
            {
                _frmXuatLop = new frmXuatLop();
                _frmXuatLop.MdiParent = this;
                _frmXuatLop.Show();
            }
            else
                _frmXuatLop.Activate();

        }

        frmQLThamGia _frmQLThamGia=null;
        private void btnThamGia_Click(object sender, EventArgs e)
        {
            if (_frmQLThamGia == null || _frmQLThamGia.IsDisposed)
            {
                _frmQLThamGia = new frmQLThamGia();
                _frmQLThamGia.MdiParent = this;
                _frmQLThamGia.Show();
            }
            else
                _frmQLThamGia.Activate();
        }

        frmXuatHocSinhSaiPham _frmXuatHocSinhSaiPham = null;
        private void bntReportSaiPham_Click(object sender, EventArgs e)
        {
            if (_frmXuatHocSinhSaiPham == null || _frmXuatHocSinhSaiPham.IsDisposed)
            {
                _frmXuatHocSinhSaiPham = new frmXuatHocSinhSaiPham();
                _frmXuatHocSinhSaiPham.MdiParent = this;
                _frmXuatHocSinhSaiPham.Show();
            }
            else
                _frmXuatHocSinhSaiPham.Activate();
        }

        frmChuyenLop _frmChuyenLop = null;
        private void bntChuyenLop_Click(object sender, EventArgs e)
        {
            if (_frmChuyenLop == null || _frmChuyenLop.IsDisposed)
            {
                _frmChuyenLop = new frmChuyenLop();
                _frmChuyenLop.MdiParent = this;
                _frmChuyenLop.Show();
            }
            else
                _frmChuyenLop.Activate();
        }
        frmRaTruong _frmRaTruong = null;
        private void bntHSRaTruong_Click(object sender, EventArgs e)
        {
            if (_frmRaTruong == null || _frmRaTruong.IsDisposed)
            {
                _frmRaTruong = new frmRaTruong();
                _frmRaTruong.MdiParent = this;
                _frmRaTruong.Show();
            }
            else
                _frmRaTruong.Activate();
        }

        frmHoatDongHocSinh _frmHoatDongHS = null;
        private void bntReportPhanCong_Click(object sender, EventArgs e)
        {
            if (_frmHoatDongHS == null || _frmHoatDongHS.IsDisposed)
            {
                _frmHoatDongHS = new frmHoatDongHocSinh();
                _frmHoatDongHS.MdiParent = this;
                _frmHoatDongHS.Show();
            }
            else
                _frmHoatDongHS.Activate();
        }

        frmRenLuyenHS _frmRenLuyenHS = null;
        private void bntReportRenLuyenHS_Click(object sender, EventArgs e)
        {
            if (_frmRenLuyenHS == null || _frmRenLuyenHS.IsDisposed)
            {
                _frmRenLuyenHS = new frmRenLuyenHS();
                _frmRenLuyenHS.MdiParent = this;
                _frmRenLuyenHS.Show();
            }
            else
                _frmRenLuyenHS.Activate();
        }

        private void frmChinh_Load(object sender, EventArgs e)
        {
            //frmDangNhap _frmDangNhap = new frmDangNhap();
            //_frmDangNhap.ShowDialog();
            //if (_close == 1 && m_PhanQuyenCtrl.DangNhap(_user, _pass) != 1)
            //{
            //    this.Close();
            //}
 

        }

    }
}